<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');
?>

<p>
	<a href="index.php">&lt;&lt; Back to Buildings Portal</a><br />
</p>
<h1>Edit Building</h1>

<?php

$building_id = mysql_real_escape_string(strip_tags($_GET['id']));



//select statement
$query="SELECT * FROM buildings WHERE id='$building_id'";
$result=mysql_query($query);
$row = mysql_fetch_assoc($result);

$building_name=$row["building_name"];
$abbreviation=$row["abbreviation"];

echo "<form action='edit_do.php' method='post' >";

//start table
echo "<table border='0'>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>Building Name</b></td>";
		echo "<td>";
		echo "<input type='text' name='name' value='$building_name'>";
		echo "</td>";
	echo "</tr>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>Abbreviation</b></td>";
		echo "<td>";
		echo "<input type='text' name='abbrev' value='$abbreviation'>";
		echo "</td>";
	echo "</tr>";

//end table tag
echo "</table>";

echo "<input type='hidden' name='id' value='$building_id'>";
echo '<p><input type="submit"></p>';
echo '</form>';

	

?>



<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>